﻿namespace CommonLib.Util
{
	using UnityEngine;
	static public class ComponentUtil
	{
		static public T GetComponentIfMissing<T>(this GameObject gameObject) where T : Behaviour
		{
			return gameObject.GetComponent<T>() ?? gameObject.AddComponent<T>();
		}
	}
}